package tech.senri.iot.socket.model

import io.netty.buffer.Unpooled
import io.swagger.annotations.ApiModelProperty
import tech.senri.iot.socket.service.util.getArray

class UpdateMergeAisleRequest : RequestMessage()
{
    override fun contentData(): ByteArray
    {
        return Unpooled.buffer().writeByte(enableMergeAisle)
            .writeShort(aisleGroupCount)
            .writeBytes(aisleMergeData?.map { it.toByte() }?.toByteArray())
            .getArray()

    }

    @ApiModelProperty("合并货道启用/停用", required = true)
    var enableMergeAisle: Int = 0

    @ApiModelProperty("货道组数", required = true)
    var aisleGroupCount: Int = 0

    @ApiModelProperty("货道合并设置数据,例如：[1,0] 1、2 号货道合并，3、4 号货道不合并 依次类推", required = true)
    var aisleMergeData: IntArray? = null
}
